Repository navigation
docs(axum-http-server): fix the extractor docs: the error status is 200, not 500 - #2995
Open
josecelano-bot wants to merge 1 commit into
Open
josecelano-bot wants to merge 1 commit into
josecelano-bot wants to merge 1 commit into
Conversation
…00, not 500 The announce and scrape request extractors answer missing or invalid query parameters with a bencoded failure reason and HTTP status 200 OK (StatusCode::OK), as the authentication key extractor does. Their module docs said 500.
josecelano-bot
temporarily deployed
to
coverage
November 22, 2026 14:21 — with
GitHub Actions
Inactive
Member
|
ACK e723266 |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the documentation-only correction to the announce and scrape error-status descriptions.
No open issues 🎉
What changed in this PR
This documentation-only PR corrects the HTTP error status documented by the announce and scrape request extractors in axum-http-server, aligning it with existing behavior.
Changes:
- Replaces
500with200 OKfor bencoded errors caused by missing or invalid query parameters. - Leaves runtime behavior and tests unchanged.
| File | Description |
|---|---|
packages/axum-http-server/src/v1/extractors/scrape_request.rs |
Corrects the documented scrape error status to 200 OK. |
packages/axum-http-server/src/v1/extractors/announce_request.rs |
Corrects the documented announce error status to 200 OK. |
Review effort: Balanced
Member
|
ACK e723266 |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The module docs of the announce and scrape request extractors say the bencoded error response has HTTP status
500when the query parameters are missing or invalid. The real status is200 OK: both extractors return(StatusCode::OK, error.write()), and the contract tests assert200(for exampleassert_missing_query_params_for_announce_request_error_response). BEP 3 sets no status code for errors. This PR makes the two docs say200 OK, in the wording ofauthentication_key.rs.Where it was found: manual runs and tests in the sub-issues SI-3 and SI-4 of EPIC #2912 returned 200 for malformed requests, which contradicted these docs. No other extractor or handler doc in
packages/axum-http-serverhas the mistake.Files
packages/axum-http-server/src/v1/extractors/announce_request.rs(doc comment only)packages/axum-http-server/src/v1/extractors/scrape_request.rs(doc comment only)Validation
contrib/dev-tools/git/hooks/pre-commit.shpassed:linter all, rustfmt,cargo macheteand the doc tests. No code changes.